@extends('admin.layout')
@section('title', $title)
@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                订单管理
                <small>订单列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">订单</a></li>
                <li class="active">订单列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">{{ $stitle }}</h3>
                        </div><!-- /.box-header -->
                        @if(session('info'))
                            <div class="alert alert-success alert-dismissable"
                                 id="info">
                                {{ session('info') }}
                            </div>
                        @endif
                        <section class="content-header">
                        <div class = "row">
                            <table class="table table-bordered text-center">
                                <tr>
                                    <td>
                                        <a href = "/admin/indent/index"><button class="btn btn-block btn-info btn-lg">全部订单</button></a>
                                    </td>
                                    <td>
                                        <a href = "/admin/indent/is_send"><button class="btn btn-block btn-info btn-lg">待发货</button></a>
                                    </td>
                                    <td>
                                        <a href = "/admin/indent/is_receive"><button class="btn btn-block btn-info btn-lg">待收货</button></a>
                                    </td>
                                    <td>
                                        <a href = "/admin/indent/is_comment"><button class="btn btn-block btn-info btn-lg">待评价</button></a>
                                    </td>
                                    <td>
                                        <a href = "/admin/indent/is_pay"><button class="btn btn-block btn-info btn-lg">待支付</button></a>
                                    </td>
                                    <td>
                                        <a href = "/admin/indent/finsh"><button class="btn btn-block btn-info btn-lg">已完成订单</button></a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        </section>
                        <div class="box-body">

                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>商品</th>
                                    <th>支付</th>
                                    <th>发货</th>
                                    <th>收货</th>
                                    <th>下单时间</th>
                                    <th>收货人</th>
                                    <th>电话</th>
                                    <th>收货地址</th>
                                </tr>
                                </thead>
                                <tbody>
                                    @foreach($data as $v)
                                    <tr>
                                        <td id = "ids">{{ $v -> id }}</td>
                                        <td>{{ $v -> goodsname }}</td>
                                        <td>
                                            @if($v-> is_pay == 0)
                                            未支付
                                            @elseif($v -> is_pay == 1)
                                            已支付
                                            @endif
                                        </td>
                                        <td>
                                            @if($v-> is_send == 0)
                                            <a href = "/admin/indent/sendEdit/{{ $v -> id }}">未发货</a>
                                            @elseif($v -> is_send == 1)
                                            已发货
                                            @endif
                                        </td>
                                        <td>
                                            @if($v->is_receive == 0)
                                            未收货
                                            @elseif($v -> is_receive == 1)
                                            已收货
                                            @endif
                                        </td>
                                        <td>{{ $v -> time }}</td>
                                        <td>{{ $v -> recname }}</td>
                                        <td>{{ $v -> phone }}</td>
                                        <td>{{ $v -> address }}</td>
                                    </tr>
                                    @endforeach
                                </tbody>
                            </table>
                            {{ $data ->render() }}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    <script type="text/javascript">
        window.onload = function () {
            setInterval(function () {
                $('#info').slideUp(1000);
            }, 3000)
        }
    </script>
@endsection()